﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace 期末考试
{
    public partial class Form2 : Form
    {
        public Form2()
        {
            InitializeComponent();
        }

        private void label1_Click(object sender, EventArgs e)
        {

        }

        private void button1_Click(object sender, EventArgs e)
        {
            //var userid = "admin";
            //var password = 123;
            sqlData udata = new sqlData();
            var UID = textBox1.Text;
            var PWD = textBox3.Text;

            udata.username = textBox1.Text;
            udata.password = textBox3.Text;

            new sqlDA().addData(udata);
            if(UID != String.Empty || PWD != String.Empty)
            {
                MessageBox.Show("登入成功");
            }
            else
            {
               MessageBox.Show("登入失败");
            }
        }

        private void button2_Click(object sender, EventArgs e)
        {
            Form2 form2 = new Form2();
            form2.Hide();
            Form3 form = new Form3();
            form.Show();
            
        }
    }
}
